﻿<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>购物车 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/zepto.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/weui.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/cart.js"></script>
<script type="text/javascript">
$(function(){
    $(".weui-tabbar a").eq(1).addClass("weui-bar__item_on"); //选中Tab
});
</script>
</head>

<body ontouchstart>
<div class="page">
    <!--页面头部-->
    <div class="header">
        <a class="back" href="javascript:history.back();">
            <i class="iconfont icon-arrow-left"></i>
        </a>
        <h3>购物车</h3>
        <div class="right"> 
            <a class="weui-cell_access weui-cell_link" href="<%linkurl("index")%>">
                <i class="iconfont icon-home"></i>
            </a>
        </div>
    </div>
    <!--/页面头部-->
  
    <!--页面内容-->
    <div class="page__bd">
        
        <%if(goodsList.Count>0)%>
        <!--商品清单-->
        <input id="jsondata" name="jsondata" type="hidden" />
        <div class="weui-panel weui-panel_access" style="margin-top:10px;">
            <div class="weui-panel__hd">商品列表</div>
            <div class="weui-panel__bd">
                <div class="cart-list">
                    <ul>
                        <%foreach(ByteSite.Entitys.cart_items modelt in goodsList)%>
                        <li>
                            <input name="hideChannelId" type="hidden" value="{modelt.channel_id}" />
                            <input name="hideArticleId" type="hidden" value="{modelt.article_id}" />
                            <input name="hideGoodsId" type="hidden" value="{modelt.goods_id}" />
                            <input name="hideStockQuantity" type="hidden" value="{modelt.stock_quantity}" />
                            <input name="hideGoodsPrice" type="hidden" value="{modelt.user_price}" />
                            <input name="hidePoint" type="hidden" value="{modelt.point}" />
                            <label class="select">
                                <input type="checkbox" name="checkall" class="checkall" onclick="selectCart();" />
                            </label>
                            <a href="javascript:;" class="img-box">
                                <img src="{modelt.img_url}" />
                            </a>
                            <h2>{modelt.title}</h2>
                            <p class="stxt">{modelt.spec_text}</p>
                            <div class="note">
                                <div class="btn-list">
                                    <a href="javascript:;" onclick="updateCart(this, '{config.webpath}', -1);">-</a>
                                    <input name="goodsQuantity" type="text" value="{modelt.quantity}" onblur="updateCart(this, '{config.webpath}');" onkeydown="return checkNumber(event);" />
                                    <a href="javascript:;" onclick="updateCart(this, '{config.webpath}', 1);">+</a>
                                    <a class="del" href="javascript:;" onclick="deleteCart('{config.webpath}', this);">删除</a>
                                </div>
                                <i class="price">¥{modelt.user_price}</i>
                            </div>
                        </li>
                        <%/foreach%>
                    </ul>
                </div>
                
                <%if(goodsList.Count>0)%>
                <div class="cart-foot">
                    <div>
                        <a class="all" href="javascript:;" onclick="selectCart(this);">
                            <i class="iconfont icon-all"></i>
                            <span>全选</span>
                        </a>
                        <a class="btn" href="javascript:;" onclick="formSubmit(this, '{config.webpath}', '<%linkurl("shopping")%>');">
                            去结算(<b id="totalQuantity">0</b>)
                        </a>
                        <div class="total">
                            <p>共计：￥<b id="totalAmount">0</b>元</p>
                        </div>
                    </div>
                </div>
                <%/if%>
            </div>
        </div>
        <!--/商品清单-->
        <%/if%>
        
        <%if(goodsList.Count==0)%>
        <!--购物车为空-->
        <div class="weui-msg msg-box">
            <div class="weui-msg__icon-area">
                <i class="weui-icon-info weui-icon_msg"></i>
            </div>
            <div class="weui-msg__text-area">
                <h2 class="weui-msg__title">暂无商品</h2>
                <p class="weui-msg__desc">
                    购物车暂无任何商品，马上去选一件吧！
                </p>
            </div>
            <div class="weui-msg__opr-area">
                <p class="weui-btn-area">
                    <a class="weui-btn weui-btn_primary" href="javascript:history.back();">返回首页</a>
                </p>
            </div>
            
        </div>
        <!--/购物车为空-->
        <%/if%>
    
        <!--版权信息-->
        <%template src="_copyright.html"%>
        <!--/版权信息-->

        <!--底部导航-->
        <%template src="_footer.html"%>
        <!--/底部导航-->
    
  </div>
  <!--/页面内容-->

</div>
</body>
</html>
